package modele;

import java.util.Scanner;

public class Pool {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		System.out.println("How many baskets ?");
		int nbB = Integer.parseInt(sc.nextLine());
		System.out.println("How many cubicle ?");
		int nbC = Integer.parseInt(sc.nextLine());

		BasketPool baskets = new BasketPool(nbB);
		CubiclePool cubicles = new CubiclePool(nbC);
		FairScheduler s = new FairScheduler();

		s.addAction(new Swimmer("Camille", baskets, cubicles, 6, 4, 8));
		s.addAction(new Swimmer("Lois", baskets, cubicles, 2, 10, 4));
		s.addAction(new Swimmer("Mae", baskets, cubicles, 10, 18, 10));
		s.addAction(new Swimmer("Ange", baskets, cubicles, 3, 7, 5));
		s.addAction(new Swimmer("Louison", baskets, cubicles, 18, 3, 3));
		s.addAction(new Swimmer("Charlie", baskets, cubicles, 3, 6, 10));
		s.addAction(new Swimmer("Alexis", baskets, cubicles, 6, 5, 7));

		int nbSteps = 0;

		while (!s.isFinished()) {
			System.out.print("["+nbSteps+"] ");
			nbSteps++;
			s.reallyDoStep();
		}
		System.out.println("Finished in " + nbSteps + " steps");
	}

}
